

/**
 * 通话套餐类
 */
public class PhonePackage extends AbstractPackage implements PhoneService{
    //通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息
    private int callTime;
    private int messageNum;

    public void show() {
        System.out.println("我的套餐为:通话时长" + callTime + "分钟, 每月短信条数:" + messageNum + ", 每月资费:" + monthlyCharges + "元");
    }

    @Override
    /**
     * 获取每月资费: 通话时长乘以通话每分钟费用, 短信数量乘以短信价格.
     * 假设每分钟通话0.2元, 每条短信0.1元
     */
    public double calMonthlyCharges() {
        return callTime * 0.2 + messageNum * 0.1;
    }

    public PhonePackage() {
    }

    public PhonePackage(int callTime, int messageNum, double monthlyCharges) {
        super(monthlyCharges);
        setCallTime(callTime);
        setMessageNum(messageNum);
    }

    public int getCallTime() {
        return callTime;
    }

    public void setCallTime(int callTime) {
        this.callTime = callTime;
    }

    public int getMessageNum() {
        return messageNum;
    }

    public void setMessageNum(int messageNum) {
        this.messageNum = messageNum;
    }


    @Override
    public void callService(int callTime, PhoneCardType phoneCardType) {
        System.out.println(
                "您的手机卡类型是:" + phoneCardType.getCardType() + ", 您的通话时间是:" + callTime +
                ", 请愉快的打电话吧!!!"
        );
    }
}
